# -*- coding: utf-8 -*-
# strip() 方法用于移除字符串头尾指定的字符（默认为空格或换行符）或字符序列
info = '    my name is dewei    '
new_info = info.strip() # 删除头尾空格
print('.' + new_info + '.')

info_01 = 'my name is dewei'
new_info_01 = info_01.strip(info_01)
print(new_info_01)
print(len(new_info_01))


new_str = 'abcde'
print(new_str.lstrip('a')) #删除开头a
print(new_str.rstrip('e')) # #删除结尾e

str2 = '1a2b12c21'
print (str2.strip('12')) #删除头尾的1和2) a2b12c
print (str2.lstrip('12'))#删除开头的1和2) a2b12c21

str3 = 'aabcacb1111acbba'
print(str3.strip("abc")) # 1111

print(str3.strip("acb")) # 1111

print(str3.strip("bac"))# 1111

print(str3.strip("bca")) # 1111

print(str3.strip("cab")) # 1111

print(str3.strip("cba")) # 1111
